package org.zsl.controller.springmvc;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.zsl.dao.mybatis.UserMapper;
import org.zsl.model.ResponseMsg;
import org.zsl.model.User;
import org.zsl.service.UserService;
import org.zsl.service.UserService2;

import java.util.List;

@RestController
@RequestMapping("/mybatis")
public class MybatisController {

    @Autowired
    private UserService2 userService;

    @RequestMapping(value = "/list",method = RequestMethod.GET)
    public List<User> getList(){
        return  userService.getList();
    }

    @RequestMapping(value = "/register",method = RequestMethod.OPTIONS)
    public ResponseMsg register(User user){
         return  userService.register(user);
    }



}
